﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Smartee.RichText
{
    public sealed class Row : Container
    {
        private Table _parentTable;
        public Table ParentTable { get { return _parentTable; } }

        private List<Cell> _cells = new List<Cell>();
        public void Add(Cell newCell) { _cells.Add(newCell); }

        public Row(Table parentTable)
        {
            _parentTable = parentTable;
        }

        public override void Accept(IVisitor visitor)
        {
            visitor.StartVisit(this);
            foreach (Cell cell in _cells)
                cell.Accept(visitor);
            visitor.EndVisit(this);
        }
    }
}
